home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 276-300 / 288 / scripit / reference.doc < prev    next >
Text File  |  1995-03-14  |  74KB  |  1,995 lines

  1.                      Scripit 1.20 Command Reference
  2.                      ==============================
  3.  
  4.  
  5.  
  6. Introduction:
  7. -------------
  8.  
  9. Scripit is a not a language in the normal sense of computer languages.
  10. It is, instead, a script language that allows the user to automate
  11. actions he/she would normally have to do manually.  (although Scripit
  12. goes far beyond that)  Scripit can do anything the user can do manually
  13. by either the mouse or keyboard by using a set of commands that instruct
  14. Scripit to simulate specific mouse or keyboard actions.
  15.  
  16. The major concept in Scripit is that of a 'selected window.'  As you
  17. know, the Amiga's user interface consists of windows (which reside on
  18. one or more screens.)  These windows can be moved or resized, pushed to
  19. the front or back, and are used to get user input via the keyboard or
  20. mouse in the form of menu selections, boolean gadgets (clicks), string
  21. gadgets (text input), proportional gadgets (slider moves), mouse movements,
  22. mouse clicks, and keyboard actions.  Scripit can simulate all of those
  23. in order to automate actions.
  24.  
  25. The first step in any Scripit script is to select the 'selected window'
  26. which may or may not be the currently active window.  Once a window is
  27. selected, all (well, actually most) Scripit commands will act upon that
  28. window and will send simulated actions to it.  This allows Scripit to
  29. 'drive' programs that are in the background while you are working on
  30. something else.
  31.  
  32. Next, commands are issued in the script to do things to the selected
  33. window.  For example:
  34.  
  35. select window "MyProgram"
  36. menu "MenuName" "MenuItem"
  37.  
  38. This script will select the window named "MyProgram" (this is the window
  39. title displayed in its title bar) and will then simulate the user
  40. selecting the menu "MenuName" item "MenuItem".  The select window
  41. command will search for the window title specified in all of the screens
  42. in the Amiga's system at the time the script was run.  There are several
  43. select commands in Scripit that control how the window is selected.
  44.  
  45. Scripit will never allow the user to do something that the program
  46. doesn't expect.  For example, if a menu item was disabled (ghosted)
  47. Scripit will not send the simulated menu selection.  This is a safety
  48. feature that makes it more reliable since the program that disabled
  49. the menu item probably did it for a very good reason.
  50.  
  51. Menu selections are just a drop in the ocean of what Scripit can do,
  52. but this should give you a taste of its power.  Scripit can also output
  53. text and graphics onto the selected window (without the program owning
  54. the window even knowing what is happening) or output text to a console
  55. (a text-based window) that it was run from or it has opened using
  56. special Scripit console control commands.
  57.  
  58. The easiest way of starting with Scripit is to use the provided
  59. 'Recorder' to record user actions as a script that can be executed
  60. again to repeat those actions.  The generated script is a valid Scripit
  61. script and can be edited and modified.  However, the Recorder does not
  62. use any of the more powerful Scripit facilities such as variables,
  63. graphics and text output, console control, or logic flow commands (such
  64. as if/else, while, goto, etc.)
  65.  
  66. Scripit can also be driven from ARexx allowing ARexx control over programs
  67. that do not have ARexx ports... but that is a different story entirely.
  68.  
  69.  
  70. ----------------------------------------------------------------------------
  71.        The following is the full reference to all Scripit commands.
  72. ----------------------------------------------------------------------------
  73.  
  74.                         Scripit Select Commands
  75.                         =======================
  76.  
  77. The SELECT commands are used to select the window Scripit will work with.
  78. For example,  'SELECT WINDOW Test' will tell Scripit to select the
  79. window titled 'Test' (actually the first window starting with 'Test')
  80. for further control.
  81.  
  82. Normally, if no SELECT command was issued, the first command that
  83. tries to do anything to a window will automatically select the currently
  84. active window.  If you issued a SELECT command and it couldn't find
  85. the window you requested, it will continue from there without
  86. aborting.  So, the next command will select the active window automatically.
  87.  
  88. The SELECT WAIT command controls the operation of all the SELECT commands.
  89. If you issue a 'SELECT WAIT 1000' command, all the SELECT commands
  90. afterwards will wait for 1000 jiffies (i.e. 1000/50 = 20 seconds) before
  91. failing and continuing with the script.  (Scripit will check for the window
  92. once every 10 jiffies.)
  93.  
  94. Also, if you specify the 'ABORT' keyword in the SELECT WAIT command, e.g.
  95. 'SELECT WAIT 1000 ABORT' all the SELECT commands will wait for the specified
  96. time, but will abort the script if the time runs out and Scripit couldn't
  97. find the requested window yet.  So, the SELECT WAIT command actually
  98. controls the operation of the 'SELECT WINDOW Test' command.
  99.  
  100. There are cases when the window you are trying to select has no title.  In
  101. that case, you can use one of the other SELECT commands for that.  They are:
  102. SELECT SCREEN, which selects the first window in the specified screen.
  103. SELECT MENU, which selects the window by the name of one of its menus.
  104. SELECT GADGET, which selects the window by the name of one of its gadgets.
  105. SELECT ACTIVE, which selects the active window.
  106.  
  107.  
  108. Command Summary:
  109. ----------------
  110.  
  111. SELECT      screenname windowname
  112.  
  113.             Select the Screen (and window) all the other commands will work
  114.             on.  If no SELECT command was used, the currently active window
  115.             will be selected.  (In all cases, the first match will be used.)
  116.  
  117. S SCREEN    screenname
  118.  
  119.             Select the first window in the specified screen.
  120.  
  121. S WINDOW    windowname
  122.  
  123.             Select the specified window.  (Searches through all the screens
  124.             in the system.)
  125.  
  126. S ACTIVE    Select the currently active window.
  127.  
  128. S MENU      menuname
  129.  
  130.             This will force the screen/window search to look for the
  131.             specified menu as the search criterion for the SELECT command.
  132.             This should only be used with programs that have no screen or
  133.             window name.  (e.g. to select DPaint: SELECT MENU Picture)
  134.             Make sure you select a menu name that is unique to the program
  135.             you're looking for.
  136.  
  137. S GADGET    gadgetname
  138.  
  139.             This will force the screen/window search to look for the
  140.             specified gadget name as the search criterion for the SELECT
  141.             command.  This should be used only when the program has no
  142.             no screen or window name, or any menus.  Make sure you select
  143.             a gadget name unique to the window you're looking for.
  144.  
  145. S WAIT      [MaxDelay] [ABORT]
  146.  
  147.             This sets the time all the SELECT commands will keep trying
  148.             to find the requested screen, window, menu, or gadget.  The
  149.             MaxDelay is specified in ticks, (50 per second).  The ABORT
  150.             keyword, when specified, tells Scripit to abort the script if
  151.             the requested window, etc. could not be found in the specified
  152.             time, otherwise, if the ABORT keyword was not specified, the
  153.             script will just continue.  Example:  SELECT WAIT 500 ABORT
  154.             This means:  Wait for 10 seconds (500/50) and if nothing found
  155.             then abort the script.  The S WAIT command doesn't do anything
  156.             by itself, it only modifies the operation of the other SELECT
  157.             commands (except for SELECT ACTIVE.)
  158.             To turn the wait off, just type 'S WAIT' alone.
  159.  
  160. Return Codes:
  161. -------------
  162.  
  163.             All select commands (except SELECT WAIT) will fill in #result
  164.             with 1 for success or 0 for failure.  If #result is true, then
  165.             #result2 will have the actual window's address, and #result3
  166.             will have the actual screen's address.  $window will contain
  167.             the window's title and $screen will contain the screen's title.
  168.  
  169.  
  170. Note:       In all SELECT commands, SELECT can be replaced with an 'S'.
  171. -----       e.g.  'S ACTIVE' is the same as 'SELECT ACTIVE'.
  172.  
  173. ----------------------------------------------------------------------------
  174.  
  175.                                Main Commands
  176.                                =============
  177.  
  178.  
  179. The following commands mostly simulate user actions.  (i.e. menus, gadgets,
  180. mousemoves, keyboard keys, etc.)
  181.  
  182.  
  183. MENU        menu menuitem <subitem>
  184.  
  185.             Simulate a menu selection from the selected window's menu.  The
  186.             input is 'menu' 'menuitem' and if needed 'subitem'.  This
  187.             command needs at least the first two to work.  Note 1 explains
  188.             naming conventions.  (If the window has the MENUVERIFY flag set
  189.             Scripit will send a MENUVERIFY msg and wait for a reply to it
  190.             before sending the actual menu select message.)
  191.  
  192.             Return Codes:
  193.  
  194.             #result  :  1 for success, 0 for failure.
  195.             $result  :  Menu name
  196.             $result2 :  Item name
  197.             $result3 :  Subitem name (if exists)
  198.             if #result == 0, then:
  199.             #result2 :  0 for menu not found, 10 for menu disabled.
  200.  
  201.  
  202. GADGET      gadgetname ID NUM X Y 
  203.  
  204.             This controls the gadgets of the selected window.  It needs a
  205.             gadgetname (or number) to identify the gadget and, depending
  206.             on the gadget type needs more arguments to modify that
  207.             gadget's contents.  It will send both a GadgetUp and a
  208.             GadgetDown message if the window's flags request that.
  209.             (See Note 3 for more info.)
  210.  
  211.             Return Codes:
  212.             -------------
  213.  
  214.             ALL gadget commands (GADGET, GADGETDOWN, GADGETUP & GETGADGET)
  215.             fill in the following return codes:
  216.  
  217.             $result  : full text name of gadget (if exists)
  218.  
  219.             #result  : 0 = failure (gadget not found), 1 = bool gadget,
  220.                        2 = prop gadget, 3 = string gadget
  221.  
  222.             if #result == 1 : (bool gadget)
  223.                    #result2 : 0 = gadget not selected, 1 = gadget selected
  224.  
  225.             if #result == 2 : (prop gadget)
  226.                    #result2 : prop gadget horizontal position (0-65536)
  227.                    #result3 : prop gadget  vertical  position (0-65536)
  228.  
  229.             if #result == 3 : (string gadget)
  230.                    $result2 : current contents of string gadget
  231.                    $result3 : contents of string gadget undo buffer
  232.  
  233. GADGET      boolgadgetname ID NUM X Y
  234.  
  235.             Triggers a selected bool gadget from the selected window.
  236.  
  237. GADGET      stringgadgetname ID NUM X Y newstring
  238.  
  239.             Replaces the string in a string gadget with a new string and
  240.             simulates a 'return' on the gadget.  [opt1] is the new string.
  241.             
  242. GADGET      propgadgetname ID NUM X Y horz,vert
  243.  
  244.             Changes the position of a proportional gadget.  The input values
  245.             reflect the horizontal and vertical prop position of the gadget.
  246.             (Values allowed: 0-65535)  [horz] is the horizontal position,
  247.             and [vert] is the vertical position.
  248.  
  249. GADGETDOWN  Does the same job as 'GADGET' except that it will only send
  250.             GadgetDown messages and not GadgetUp messages.
  251.             (For use with Recorder scripts.)
  252.  
  253. GADGETUP    Does the same job as 'GADGET' except that it will only send
  254.             GadgetUp messages and not GadgetDown messages.
  255.             (For use with Recorder scripts.)
  256.  
  257. GETGADGET   gadgetname ID NUM
  258.  
  259.             This is identical to the GADGET command, except that it doesn't
  260.             actually trigger or do anything to the gadget.  It will just
  261.             check the gadget's status and fill in the corresponding result
  262.             variables as per the GADGET command's return results.
  263.             
  264. WAIT        <delay>
  265.  
  266.             Suspends script execution for delay * 1/50th seconds.  Default
  267.             delay time is 25, i.e. 1/2 second.
  268.             
  269. LMB         x,y
  270.  
  271.             Simulate clicking the left mouse button while the pointer
  272.             is at position x,y.
  273.             Related   : SELECTUP    Sends only LMBUp message.
  274.             Commands  : SELECTDOWN  Sends only LMBDown message.
  275.  
  276. RMB         x,y
  277.  
  278.             Simulate clicking the right mouse button while the pointer
  279.             is at position x,y.
  280.             Related   : MENUUP      Sends only RMBUp message.
  281.             Commands  : MENUDOWN    Sends only RMBDown message.
  282.  
  283. DOUBLECLICK Simulate a double click.  This can be one of the following:
  284.  
  285.             DOUBLECLICK GADGET boolgadget
  286.             DOUBLECLICK RMB
  287.             DOUBLECLICK LMB
  288.  
  289.             The delay between the two clicks is controlled by the double-
  290.             click setting in Preferences.
  291.  
  292. VERBOSE     [ON] or [FULL] or [OFF]
  293.  
  294.             Turns on debug text printout to the console window.  Default
  295.             mode is off.  VERBOSE ON will turn it on, any keyword other
  296.             than 'ON' will turn it off except VERBOSE FULL which will turn
  297.             on full debug display.
  298.  
  299. DRAG        x,y,x2,y2,[steps]
  300.  
  301.             This is intended for use with WorkBench.  It will click on an
  302.             icon at x,y (if it exists) and will keep holding down the button
  303.             while moving the icon to x2,y2 where it will release the button.
  304.             It is the equivalent of:
  305.                 (RMBDOWN x,y + MOUSEMOVE x2,y2 + RMBUP x2,y2).
  306.             Steps, if specified, will make the drag into an actual drag by
  307.             inserting interim MOUSEMOVE commands between the RMBDOWN and
  308.             RMBUP.  The number of interim moves is the number of steps
  309.             specified.
  310.  
  311. MOUSEMOVE   x,y
  312.  
  313.             Simulates mouse movement to x,y.  (Sends a MOUSEMOVE message.)
  314.  
  315. DELTAMOVE   x,y
  316.  
  317.             Simulate mouse movement by x,y. (Sends a DELTAMOVE message.)
  318.  
  319. RAWKEY      code,qualifier
  320.  
  321.             Sends a RAWKEY event to the program owning the selected window.
  322.             This command is only intended for script generated by the auto-
  323.             script generator, Recorder.
  324.  
  325. ITICK       x,y
  326.  
  327.             Sends an INTUITICKS event to the program.  This is only intended
  328.             for scripts generated by the Recorder.
  329.  
  330. POINTER     x,y [l] [L] [r] [R]
  331.  
  332.             Pointer will move the mouse pointer to position x,y on the
  333.             current screen.  This will _really_ move the pointer not just
  334.             simulate it. The qualifier (one of the following l,L,r,R)
  335.             simulates left mouse button down, left mouse button up, right
  336.             mouse button down, right mouse button up.
  337.  
  338.  
  339. DRAW        x,y x2,y2 x3,y3 ..... xn,yn
  340.  
  341.             A specialized command used for drawing on DeluxePaint's screen.
  342.  
  343.             It simulates the following:
  344.                 POINTER x,y l
  345.                 POINTER x2,y2 L
  346.                 POINTER x2,y2 l
  347.                 POINTER x2,y2 L
  348.                 ....
  349.                 POINTER xn,yn l
  350.                 POINTER xn,yn L
  351.  
  352. WAITFOR     screen window <maxdelay> [ABORT]
  353.  
  354.             This command is obsolete.  You should use the SELECT WAIT
  355.             command instead.  This was left in here for compatibility
  356.             with older scripts only.
  357.  
  358. RUN         <program>
  359.  
  360.             Simply runs another program.  Control returns immediately to the
  361.             script which continues executing.  If you want to include any
  362.             command line switches, then RUN "programname switches.."
  363.             Read note 4.
  364.  
  365. RUNBACK     <program>
  366.  
  367.             Simply runs another program.  Control returns immediately to the
  368.             script which continues executing.  The program will not have any
  369.             input or output streams.  Read note 4.
  370.  
  371. EXECUTE     <program>
  372.  
  373.             Executes another program.  Script processing will wait until the
  374.             program exits.  You can also use the shorthand version of this
  375.             command:  'X'.  (e.g. X list)  Read note 4.
  376.  
  377. REQUEST     [requester title] [default dir] [default file] [left edge]
  378.             [top edge] [req width] [req height]
  379.  
  380.             This brings up the Scripit file requester and allows the user to
  381.             select a file.  The return value of the requester is stored in
  382.             system variable $request.  (see 'System Variables')  The
  383.             arguments provided to REQUEST are not necessary, but they
  384.             override the defaults.  The requester's title is "Please Select
  385.             A File:" unless you supply one.  The default dir and default
  386.             file are whatever was in the File Requester the last time it was
  387.             run.  The left edge, top edge, width and height control the size
  388.             and placement of the requester when it comes up.  (The requester
  389.             itself is totally resizable and moveable by the user.)  If none
  390.             of those was specified, the requester will come up where it was
  391.             the last time it was used.
  392.             NOTE:  The requester will always show up on the selected screen!
  393.             (or on the Workbench screen if none was selected.)   
  394.             Important:  This function is not available in 'Xit' only in
  395.             the 'Scripit' program itself.
  396.  
  397. ABORT       [ON] or [PAUSE] or [OFF]
  398.  
  399.             ABORT controls whether the abort and pause/restart facilities
  400.             work or not.  ABORT OFF disables both the abort and the pause/
  401.             restart facilities.  ABORT PAUSE only allows the pause/restart
  402.             but not the abort facility.  And ABORT ON, which is the default
  403.             mode, allows both.
  404.  
  405.             Abort facility:  You can break out of a script that is currently
  406.             executing by holding down both the left mouse button and the
  407.             control key on the keyboard.
  408.  
  409.             Pause/restart facility:  You can stop the execution of a script
  410.             at any time by pressing the left mouse button and the left shift
  411.             key at the same time.  To resume the script press the left mouse
  412.             button and then right shift key.  (you can also use the abort
  413.             facility even when a script is paused.)
  414.  
  415. FORMAT      formatstring arg1 arg2 ... argn
  416.  
  417.             FORMAT is a text formatting function that does the same function
  418.             that sprintf() does in the C language.  It uses the same format
  419.             as sprintf().  The following is the full explanation of it:
  420.             The formatting result string is stored in $result.
  421.  
  422.             The format string contains two types of items: normal text
  423.             characters and 'coversion specifications', each of which causes
  424.             the conversion and output of the next successive argument.
  425.             The conversion specification always starts with a % and
  426.             continues with some optional characters, then the conversion
  427.             type characters, which can be any of the following: d, o, x,
  428.             u, c, or s.
  429.  
  430.             For example:
  431.  
  432.             $name = "Khalid Aldoseri"
  433.             #age  = 24
  434.             FORMAT "Name : %s    Age : %d" $name #age
  435.             
  436.             After this, $result will contain:            
  437.  
  438.             "Name : Khalid Aldoseri    Age : 24"
  439.  
  440.  
  441.             Conversion Characters:
  442.             ----------------------
  443.  
  444.             d, o, or x      The integer in the corresponding argument is
  445.                             converted to decimal, octal, or hexadecimal
  446.                             notation, respectively, and output to the
  447.                             result string.
  448.  
  449.             u               Converts an unsigned integer.
  450.  
  451.             c               Converts the integer to a single character
  452.                             based on the standard ASCII tables.
  453.  
  454.             s               The characters in the corresponding argument
  455.                             are output.
  456.  
  457.  
  458.             Optional specifications:
  459.             ------------------------
  460.  
  461.             These come in between the % and the conversion character.
  462.  
  463.             a.  An optional minus sign (-) which specifies left adjustment of
  464.                 the converted integer or string.
  465.  
  466.             b.  An optional digit string specifying the 'field width' for the
  467.                 conversion.  If the resulting string has fewer characters
  468.                 than this, enough blank characters are output to make the
  469.                 total number of characters output equal the field width.
  470.                 If the field width digits have a leading 0, 0 is used as a
  471.                 pad character rather than a blank.  The minus sign controls
  472.                 whether the blanks are output before or after the string.
  473.             
  474.             For example:
  475.             
  476.             FORMAT "Hex: %08x  Decimal: %8d" 10 10
  477.  
  478.             Then, $result will contain "Hex: 0000000a  Decimal:       10"
  479.             
  480. PRINTF      formatstring arg1 arg2 ... argn
  481.  
  482.             PRINTF does exactly the same job as FORMAT, except that it will
  483.             print out the result string to the current console.  The result
  484.             will still be available in $result.  PRINTF also allows for the
  485.             special character codes as listed in the next command.
  486.  
  487. PRINT       arg1 arg2 ... argn
  488.  
  489.             Prints out the strings provided to the current console.  The
  490.             is not terminated after each string.  You can also use any of
  491.             the following special codes in the strings:
  492.  
  493.                 \n  Return + Line feed
  494.                 \e  Return (no line feed)
  495.                 \r  Same as \e
  496.                 \t  Tab
  497.                 \b  Backspace
  498.  
  499.             E.g.:   PRINT "Test\n"
  500.  
  501.             These codes are only translated into actual returns, etc. when
  502.             the string is about to be printed, so if you store such codes in
  503.             a string variable, the code is stored, not the actual ASCII
  504.             character.  These codes are also supported by the PRINTF,
  505.             CON ECHO, and CON TEXT commands.
  506.  
  507.  
  508. Note 1:     Argument format for Screen, Window, Menu and Gadget Selection:
  509. -------
  510.             The required item can be selected by specifying:
  511.  
  512.             a.  The item's name.  This is NOT case-sensitive.  Abbreviations
  513.                 are allowed.  (i.e. 'Pro' will match the first item that
  514.                 starts with 'Pro' e.g. 'Project'.)
  515.                 Leading spaces are ignored.
  516.  
  517.             b.  The item's number.  This is the sequential number of the
  518.                 item in its list.  This must always start with '^' and a
  519.                 number. (e.g.  'MENU ^1 ^4 ^3' will select the first menu,
  520.                 the fourth menuitem, and the 3rd subitem.)
  521.  
  522. Note 2:     Arguments can be separated by one or more spaces, tabs, or a
  523. -------     comma.  Any string argument can be surrounded with double-quotes
  524.             to include spaces in its text.  (e.g.  "Text string")  All
  525.             numeric arguments are integer.  (i.e. no fractions allowed)  Any
  526.             argument can be substituted by a string or integer variable.
  527.             (Read section on 'Variables.')
  528.  
  529. Note 3:     Gadgets are selected by one of the following methods:
  530. -------     
  531.             a.  Gadget Name:
  532.                 This is the text that is normally attached to a gadget.  Few
  533.                 programs attach text to gadgets.  (Also use Lister for
  534.                 gadget names.)
  535.             b.  Gadget ID:
  536.                 This is the gadget's ID number.  Most programs have unique
  537.                 ID numbers for each gadget.  You can find out a gadget's ID
  538.                 by using the 'Lister' program.
  539.             c.  Serial Number:
  540.                 This is just a serial number of the gadget.  It is reliable
  541.                 in some programs, and unreliable in others.
  542.  
  543.             Scripit will search for the gadget based on the following logic:
  544.  
  545.             1.  Search for gadget name, first gadget that matches the name
  546.                 will be selected.  If no matching gadget found, or gadget
  547.                 name was a null (""), then:
  548.             2.  Search for ID.  If found ID, then gadget found, unless more
  549.                 than more gadget with the same ID was found.
  550.             3.  As a last resort, scan for the gadget by its serial number.
  551.  
  552.             Examples:
  553.  
  554.             a. Bool Gadget:
  555.   
  556.             GADGET "gadname" 323,6,10,34
  557.  
  558.             This will search for "gadname" first, then ID 323, then #6.  The
  559.             X (10) and Y (34) settings are fed into the message sent to the
  560.             program because some programs need to know where the pointer is
  561.             when the gadget was clicked on.
  562.  
  563.             b. String Gadget:
  564.   
  565.             GADGET "gadname" 323,6,10,34 "newstring"
  566.                 
  567.             c. Prop Gadget:
  568.   
  569.             GADGET "gadname" 323,6,10,34 horz,vert
  570.  
  571.  
  572. Note 4:     The EXECUTE, RUN, and RUNBACK commands will interpret any
  573. -------     arguments added after the command and these arguments are
  574.             correctly passed to the command being executed/run.
  575.  
  576.             For example:
  577.  
  578.             RUN list df0:
  579.  
  580.             To give null arguments to a program, just use "".  e.g.:
  581.  
  582.             X Lister "" workbench
  583.  
  584.             Of course, any program name or argument that contains spaces or
  585.             commas needs to be in double quotes.
  586.  
  587. Note 5:     The following commands return #result = 1 if successful, 0 if
  588. -------     failed:  (success is if the message was delivered correctly to
  589.             the program.)
  590.  
  591.             LMB, RMB, DOUBLECLICK, DRAG, MOUSEMOVE, DELTAMOVE, RAWKEY,
  592.             ITICK, POINTER, DRAW.
  593.  
  594. ----------------------------------------------------------------------------
  595.  
  596.                         Scripit Graphics Commands
  597.                         =========================
  598.  
  599.  
  600. These commands draw directly on the specified window (i.e. into its
  601. RastPort,  if you understand what that means)  The program owning the window
  602. will not know if you changed the contents of the window.
  603. To use those, just SELECT the window you want, and start drawing!
  604.  
  605.     (Note:  To select DPaint's window, use SELECT MENU PICTURE)
  606.  
  607.  
  608. GFX PEN         front_pen,back_pen,drawmode
  609.  
  610.                 This sets the current front pen, back pen, and draw mode.
  611.                 The pen number can range from 0 to the number of colors on
  612.                 the screen.  The draw mode can be one of the following:
  613.                 JAM1 (the background color, 0, does not overwrite what is
  614.                 underneath it.)  JAM2 (color 0 clears whatever is underneath
  615.                 it.)  COMP (the complement mode reverse the color of the
  616.                 original pixel.)  and INVR (which is the same as JAM2, only
  617.                 with the front and back pen reversed.)
  618.  
  619. GFX MOVE        x,y
  620.  
  621.                 Moves the windows 'cursor' to the specified x,y coords.
  622.                 This affects where drawing will start.
  623.                 
  624. GFX TEXT        "string"
  625.  
  626.                 Prints the specified string in the current font to the
  627.                 position selected by MOVE. (using the current front pen,
  628.                 back pen, and drawing mode.)
  629.  
  630. GFX LINE        x1,y1 x2,y2 .... xn,yn
  631.  
  632.                 Draws connected straight lines.
  633.  
  634. GFX CIRCLE      x,y,radius
  635.  
  636.                 Draws a circle at x,y using the specified radius
  637.  
  638. GFX ELLIPSE     x,y,x_radius,y_radius
  639.  
  640.                 Draws an ellipse at x,y using the specified x_radius and
  641.                 y_radius.
  642.  
  643. GFX BOX         x,y,x2,y2
  644.  
  645.                 Draws a rectangle.  x,y and x2,y2 are any two opposite
  646.                 corners.
  647.  
  648. GFX RECT        x,y,x2,y2
  649.  
  650.                 Draws a filled-in rectangular.  x,y and x2,y2 are any two
  651.                 opposite corners.
  652.  
  653. GFX CLEAR       x,y
  654.  
  655.                 Clears the current window.  The x,y are optional and select
  656.                 the start position for clearing.
  657.  
  658. GFX CLEARLINE   x,y
  659.  
  660.                 Clear to the end of the current line starting at x,y.
  661.  
  662. GFX FILL        x,y,fillmode
  663.  
  664.                 Does a flood-fill at the selected x,y using the current
  665.                 front pen.  Fillmode can be either 0 or 1.
  666.                 (Note:  This is currently not working very well, but I opted
  667.                 to keep it in here.)
  668.  
  669. GFX PIXEL       x,y
  670.  
  671.                 Draws a single pixel at x,y using the current frontpen and
  672.                 drawmode.
  673.  
  674. GFX SAVEMODE    modenumber
  675.  
  676.                 This saves the current settings (front pen, back pen, draw
  677.                 mode, and current x,y) to a temporary storage.  The
  678.                 modenumber selects the storage slot number.  (from 0 to 3)
  679.                 You should always use the GFX SAVEMODE command before
  680.                 changing anything in the window, and restore them using the
  681.                 next command as soon as possible.
  682.  
  683. GFX RESTOREMODE modenumber
  684.  
  685.                 Restores the current settings to those stored in the
  686.                 selected location.  (0 to 3)
  687.  
  688.  
  689. Example:
  690. --------
  691.  
  692. select window "Workbench"
  693. gfx savemode
  694. gfx move 10,10
  695. gfx pen 1,0,JAM2
  696. gfx text "Some text on the Workbench Window!"
  697. gfx restoremode
  698.  
  699. This script will select the Workbench window, save its current settings,
  700. move the draw cursor to 10,10, set the front pen to 1, back pen to 0,
  701. and draw mode to JAM2, then type some text there and finally restore the
  702. window's settings to what they were.
  703.  
  704. ----------------------------------------------------------------------------
  705.  
  706.                         Scripit Console Commands
  707.                         ========================
  708.  
  709.  
  710. Scripit can output text to any text console using its console commands.
  711. These allow both output of text and ANSI console control commands.
  712.  
  713.  
  714.             These Commands work with a CLI console only:
  715.             --------------------------------------------
  716.  
  717. CON CLS     Clears all the text in the console and moves the cursor to the
  718.             top left-hand corner.
  719.  
  720. CON ECHO    [string_1] [string_2] [string_3] ... [string_n] 
  721.  
  722.             Prints out the specified strings onto the console.  Each string
  723.             is printed on its own line.
  724.  
  725.             Please refer to the description of the PRINT command for more
  726.             details on print codes.
  727.  
  728.  
  729. CON TEXT    [string_1] [string_2] [string_3] ... [string_n]
  730.  
  731.             Prints out the specified strings onto the console.  The line is
  732.             not terminated after each string.
  733.             Note: To terminate a line use \n code  E.g.
  734.             CON TEXT "test " $test "\n"
  735.             Please refer to the description of the PRINT command for more
  736.             details on print codes.
  737.  
  738. CON MOVE    x,y
  739.  
  740.             Moves the cursor to position x,y.  If no x,y were given, the
  741.             cursor will be moved to the top left of the screen.
  742.  
  743. CON UP      [n]
  744. CON DOWN    [n]
  745. CON LEFT    [n]
  746. CON RIGHT   [n]
  747.  
  748.             Move the cursor up/down/left/right n times.  (default is 1)
  749.  
  750. CON SCROLLUP   [n]
  751. CON SCROLLDOWN [n]
  752.  
  753.             Scroll the console lines up/down n lines.  (default is 1)
  754.  
  755. CON INSLINE
  756. CON DELLINE
  757.  
  758.             Insert/Delete a line at the current cursor position.
  759.  
  760. CON INSCHAR [n]
  761. CON DELCHAR [n]
  762.  
  763.             Insert/delete [n] chars at the current cursor position.
  764.  
  765. CON CURSORON
  766. CON CURSOROFF
  767.  
  768.             Turn cursor display on/off.
  769.  
  770. CON CLREOL  Erase to end of line.
  771. CON CLREOD  Erase to end of display.
  772.  
  773. CON STYLE   <style>;<frontpen>;<backpen>
  774.  
  775.             This sets the style (bold, underline, italic, inverse) of the
  776.             text printed on the console as well as its front and back
  777.             colors.  These match the same parameters used by ANSI for the
  778.             'Select Graphic Rendition' command.
  779.  
  780.             The following is based on the Amiga RKM manual:
  781.  
  782.             Any number of parameters can be passed to the CON STYLE
  783.             command in any order.  They are separated by semi-colons.
  784.  
  785.             These parameters are:
  786.  
  787.             <style>     0           Plain text
  788.                         1           Bold
  789.                         2           Italic
  790.                         4           Underline
  791.                         7           Inverse-video
  792.  
  793.             <frontpen>  30 to 37    Selects color 0 to 7 for foreground.
  794.  
  795.             <backpen>   40 to 47    Selects color 0 to 7 for background.
  796.  
  797.             For example:  CON STYLE 1;2;33;45
  798.                           This will set the console text to bold + italic
  799.                           with a front pen of 3 and a back pen of 5.
  800.                           (note: spaces are not allowed here.)
  801.  
  802.             These parameters are cumulative.  If you set bold then later set
  803.             italic, you will get bold/italic.  To make sure that you get
  804.             only bold (or whatever) use a 0; to set plain text first.  e.g.
  805.             CON STYLE 0;1  (clears previous modes, then sets bold.)
  806.  
  807. CON OPEN    consolespec
  808.  
  809.             This opens a new console that all the CON commands will use for
  810.             output.  The format for the consolespec is the same as that for
  811.             opening a NewCLI console.  i.e.  "CON:10/15/450/195/Setup".
  812.             Note:  If you open a console _all_ text output by Scripit will
  813.             be sent to that console, including debugging text.
  814.             If Scripit needs to output any text and it was run from
  815.             Workbench and you didn't open a console, then it will
  816.             automatically open a default console for you.
  817.  
  818.             Results Codes:
  819.             #result will contain 1 if the console was opened, 0 if not.
  820.  
  821. CON CLOSE   Closes the console opened by CON OPEN.
  822.             (console is automatically closed when Scripit quits.)
  823.  
  824. CON CSI     <ANSI command>
  825.  
  826.             This sends an ANSI command to the console.  Scripit will insert
  827.             the CSI (Control Sequence Introducer) before the string and will
  828.             send the command untouched to the console.  These codes can be
  829.             found in the Amiga RKM manuals or in the AmigaDOS manual.
  830.  
  831.  
  832. Example:
  833. --------
  834.  
  835. CON CLS
  836. CON ECHO "This text is at the top of the screen."
  837. CON MOVE 0,0
  838. CON SCROLLDOWN 10
  839.  
  840. This will clear the console, type the text at the top of the console,
  841. move the cursor back to the top, and scroll all lines down 10 times.
  842.  
  843.  
  844. Note:       In all CON commands, CON can be replaced with a 'C'.
  845. -----       e.g.  'C CLS' is the same as 'CON CLS'.
  846.  
  847. ----------------------------------------------------------------------------
  848.  
  849.                     Controlling Workbench From Scripit
  850.                     ----------------------------------
  851.  
  852. Scripit can control Workbench using a special set of commands.  To do this,
  853. however, you must have 'XitLoadWB' running.  XitLoadWB comes before LoadWB
  854. in your startup sequence.  It will watch over the loading of Workbench and
  855. install hooks into Workbench that allow Scripit to find out the location
  856. of icons on the Workbench screen.
  857.  
  858. (Note: XitLoadWB has only been tested with Workbench 1.3, I have no idea
  859. whether it will continue to work as is with 1.4, or if it will need
  860. modification.)
  861.  
  862.  
  863. Installing 'XitLoadWB':
  864.  
  865. 1.  Copy the 'XitLoadWB' file to your C: directory.
  866.  
  867. 2.  Add a line 'XitLoadWB' in your s:startup-sequence right before the one
  868.     that says 'LoadWB'.
  869.  
  870.     For example, this would be part of your startup-sequence:
  871.  
  872.     ....
  873.     XitLoadWB
  874.     LoadWB
  875.     ....
  876.  
  877. Now, the next time you reboot, XitLoadWB will load and wait for LoadWB to
  878. load Workbench.  It will then install itself while Workbench is loading
  879. and display a small message confirming that it is loaded and working.
  880.  
  881. What this program does is to hook itself to Workbench while it is loading,
  882. and becomes an interface between Scripit and WB, receiving commands from
  883. Scripit and telling Workbench what to do.
  884.  
  885. XitLoadWB will wait a maximum of 60 seconds for WB to load, otherwise it
  886. will complain and abort.
  887.  
  888. With the Scripit WB commands, you do not need to 'SELECT' the Workbench
  889. window, all WB commands will automatically do that, and will restore
  890. the previously selected window.
  891.  
  892.  
  893. The following is a list of the Scripit WB Commands:
  894.  
  895.  
  896.  
  897.             Workbench Commands:  For use with Workbench only
  898.             ------------------------------------------------
  899.  
  900. WB SELECT       <icon>
  901.  
  902.                 Selects (single-clicks) a Workbench icon.
  903.                 (Will automatically deselect any icons previously selected.)
  904.  
  905. WB OPEN         <icon>
  906.  
  907.                 Opens (double-clicks) a Workbench icon.  This will open a
  908.                 drawer's window, or invoke a tool or project.
  909.                 (Will automatically deselect any icons previously selected.)
  910.  
  911. WB CLOSE        <drawer>
  912.  
  913.                 Closes a Workbench drawer.
  914.  
  915. WB DESELECT     Deselects all icons.
  916.  
  917. WB SHIFTSELECT  <icon_1> <icon_2> ..... <icon_N>
  918.  
  919.                 Shift-selects a list of icons.
  920.  
  921. WB SHIFTOPEN    <icon_1> <icon_2> ..... <icon_N>
  922.  
  923.                 Shift-selects a list of icons, and shift-double-clicks on
  924.                 the last icon in the list.
  925.  
  926. WB SNAPSHOT     This will 'Snapshot' the currently selected icons.  Use
  927.                 either the 'WB SELECT' command to select the icon, or the
  928.                 'WB SHIFTSELECT' command to select multiple icons, then
  929.                 issue this command.
  930.  
  931. WB CLEANUP      This will 'Clean Up' the currently selected drawer.
  932.  
  933. WB REDRAW       This will 'Redraw' the Workbench screen.
  934.  
  935. WB INFO         This will bring up the 'Info' window about the select icon.
  936.  
  937. WB MENU         <menu> <item>
  938.  
  939.                 Simulates selecting the specified menu/menuitem.  e.g.
  940.                 WB MENU Disk "Empty Trash" will trigger the Empty Trash
  941.                 menu.
  942.  
  943. WB DRAG         <icon> <move_x> <move_y> <steps>
  944.  
  945.                 Drags the WB icon by the specified x,y coordinates.
  946.                 (x & y can be either positive or negative)
  947.                 Specifying <steps> will make the drag smoother by showing
  948.                 the icon actually moving.  The number of steps is the number
  949.                 of times the icon will be display on route.  (I find that
  950.                 20 to 30 steps are good for long moves.)
  951.  
  952. WB DRAGTO       <icon> <destination_x> <destination_y> <steps>
  953.  
  954.                 Drags the WB icon to the specified x,y coordinates.
  955.                 (x & y can only be positive.)
  956.  
  957. WB DRAGOVER     <icon1> <icon2> <steps>
  958.  
  959.                 Drags icon1 and moves it on top of icon2.  This will achieve
  960.                 different results based on what icon1 and icon2 are.
  961.                 (e.g. copy disk or move icon into drawer)
  962.  
  963. WB FIND         <icon>
  964.  
  965.                 This will look for the specified icon on the Workbench
  966.                 screen and fill in the appropriate result codes as specified
  967.                 below.
  968.  
  969.  
  970. Result Codes:   All the WB commands will return a result code in #result.
  971. -------------   1 if found icon, 0 if not.  If #result == 1, then #result2
  972.                 will contain the X position of the icon, and #result3 will
  973.                 contain the Y position.  (these are actually the center
  974.                 point of the icon, not its left/top edges.)  $result will
  975.                 contain the actual name of the icon.  Note: all those are of
  976.                 the last icon selected in any command that uses more than
  977.                 one icon.  If #result == 0, then if #result2 == 1, then the
  978.                 icon wasn't found, or if #result2 == 10, then XitLoadWB
  979.                 couldn't be found (either it wasn't loaded, or it didn't
  980.                 work correctly.)
  981.  
  982.                 So, to test for XitLoadWB being loaded, just do a:
  983.  
  984.                 WB DESELECT
  985.                 IF #result
  986.                 CON ECHO "XitLoadWB is running."
  987.                 ENDIF
  988.  
  989.  
  990. Note:           No window select command is needed when using the WB
  991. -----           commands.  These automatically operate on the Workbench
  992.                 window.  They will not change the currently selected window.
  993.  
  994. ----------------------------------------------------------------------------
  995.  
  996.                         Scripit Window Commands
  997.                         =======================
  998.  
  999. The window control commands consist of mostly commands that control the
  1000. window's size, placement, activation, etc.  The following is a list of those
  1001. commands:
  1002.  
  1003.  
  1004. W MOVE      x,y
  1005.  
  1006.             Moves the selected window by x (Horz) and y (Vert).  Full limit
  1007.             checking is implemented so that a window cannot be moved outside
  1008.             the screen it is on.  If the specified x & y are not possible,
  1009.             the window will move in the direction requested as much as
  1010.             possible.  E.G.  window move -20,10 will move the window 20
  1011.             pixels to the left and 10 pixels down.
  1012.  
  1013. W MOVETO    x,y
  1014.  
  1015.             Moves the selected window to position x (LeftEdge) and y
  1016.             (TopEdge) with full limit checking.  If the specified x,y are
  1017.             not possible, the window will be placed in as near a position to
  1018.             the requested position as possible.
  1019.  
  1020. W RESIZE    width,height
  1021.  
  1022.             Change the selected window's height and width by +/- the
  1023.             specified width and height.  The requested parameters will be
  1024.             checked against the actual screen limits as well as the window
  1025.             limits set by the program owning that window.  The window will
  1026.             be resized as much as possible.  (A SIZEVERIFY and/or a NEWSIZE
  1027.             message will be sent if the appropriate flags were set in the
  1028.             window's flags.)
  1029.  
  1030. W RESIZETO  width,height
  1031.  
  1032.             Resize the selected window to a new width and height.  The
  1033.             requested width/height will be checked against the actual
  1034.             screen limits as well as the window limits set by the program
  1035.             owning that window.  The window will be resized as much as
  1036.             possible.  (A SIZEVERIFY and/or a NEWSIZE message will be sent
  1037.             if the appropriate flags were set in the window's flags.)
  1038.  
  1039. W MAXSIZE   Expand the selected window to the maximum size possible.
  1040.             I.E. to either the screen limits or the window limits whichever
  1041.             is smaller.
  1042.  
  1043. W MINSIZE   Shrink the selected window to the minimum size possible.
  1044.  
  1045. W FRONT     Move the selected window to the front of all other windows.
  1046.             This simulates clicking on the window's 'to front' gadget.
  1047.  
  1048. W BACK      Move the selected window to the back of all other windows.
  1049.             This simulates clicking on the window's 'to back' gadget.
  1050.  
  1051. W CLOSE     Send a message to the program owning the selected window
  1052.             requesting that it closes the window.  This actually simulates
  1053.             clicking on the window's 'close' gadget.  If the program
  1054.             wants to close the window then, it will.  Scripit will not
  1055.             attempt to force-close the window.
  1056.  
  1057. W REFRESH   Send a REFRESHWINDOW message to the selected window.  This
  1058.             tells the program owning the window that it needs refreshing.
  1059.             It is up to that program to decide whether it wants to refresh
  1060.             it or not.
  1061.  
  1062. W REFRESHFRAME
  1063.  
  1064.             Manually refreshes the window's title bar and frame gadgets.
  1065.  
  1066. W ACTIVATE  Activate the selected window.  This simulates clicking anywhere
  1067.             in that window to make it receive all intuition input.
  1068.             (If the window requires an ACTIVEWINDOW message, one will be
  1069.             sent to it.)
  1070.  
  1071. W DEACTIVATE 
  1072.  
  1073.             Deactivate the selected window.  (If the window requires an
  1074.             INACTIVEWINDOW message, one will be sent to it.)
  1075.  
  1076. W LIMITS    min_x min_y max_x max_y
  1077.  
  1078.             Change the preset limits for resizing a window to new limits.
  1079.             (This might be dangerous if the program owning the window
  1080.             depends on the window not being smaller or larger than a
  1081.             specific size.)
  1082.  
  1083.  
  1084. Note 1:     In all WINDOW commands, WINDOW can be replaced with a 'W'.
  1085. -------     e.g.  'WINDOW LIMITS' is the same as 'W LIMITS'.
  1086.  
  1087. Note 2:     Always use 'WAIT' to introduce delays between functions that
  1088. -------     move, resize, open, close windows to allow enough time for
  1089.             Intuition and/or the program to respond to the previous command.
  1090.             (e.g.  If you do a MOVETO 0,0 and then a MAXSIZE without a delay
  1091.             between the two, Intuition will probably not have moved the
  1092.             window yet at the time Scripit is requesting a resize.  This
  1093.             will mess up the resize and can have serious effects.)
  1094.  
  1095. ----------------------------------------------------------------------------
  1096.  
  1097.                         Scripit Screen Commands
  1098.                         =======================
  1099.  
  1100. These control the screen that the selected window belongs to.  You can use
  1101. the SELECT SCREEN command to select which screen these commands will act
  1102. upon.
  1103.  
  1104.  
  1105. SC FRONT    Move the selected screen to the front of all other screens.
  1106.             This simulates clicking on the screen's 'to front' gadget.
  1107.  
  1108. SC BACK     Move the selected screen to the back of all other screens.
  1109.             This simulates clicking on the screen's 'to back' gadget.
  1110.  
  1111. SC FLASH    <times> <delay>
  1112.  
  1113.             'Flash' the selected screen once.  The optional keyword <Times>
  1114.             controls how many times to flash the screen and the keyword
  1115.             <Delay> controls the delay between each flash (in 1/50 seconds.)
  1116.  
  1117. SC MOVE     x,y
  1118.  
  1119.             Moves the selected screen by x,y.  This simulates dragging the
  1120.             screen.  (The x drag does not work.  It is included for possible
  1121.             enhancements to Intuition in the future that might allow
  1122.             horizontal movements of a screen.)  Both x and y can be positive
  1123.             or negative.
  1124.  
  1125. SC MOVETO   x,y
  1126.  
  1127.             Moves the selected screen to x,y.  (read note in above command)
  1128.             x and y can only be positive.
  1129.  
  1130.  
  1131. Note:       In all SCREEN commands, SCREEN can be replaced with 'SC'.
  1132. -----       e.g.  'SCREEN FLASH' is the same as 'SC FLASH'.
  1133.  
  1134. ----------------------------------------------------------------------------
  1135.  
  1136.                         The Scripit ARexx Interface
  1137.                         ---------------------------
  1138.  
  1139.  
  1140. Scripit can be loaded in 'resident' mode, in which case it will open a port
  1141. for ARexx and wait for commands and requests from ARexx.
  1142.  
  1143. To load Scripit in Resident mode:
  1144.  
  1145.     Scripit -x [portname]
  1146.  
  1147.     Where [portname] is the name of the port that Scripit will open.  If no
  1148.     portname is specified, 'XIT' will be used.
  1149.  
  1150.  
  1151.     After that, Scripit will just sit and wait for commands from ARexx.
  1152.  
  1153.  
  1154.  
  1155.     From ARexx:
  1156.     -----------
  1157.     
  1158.     To find Scripit's port:
  1159.  
  1160.         address 'XIT'
  1161.  
  1162.     To issue a command to Scripit:
  1163.  
  1164.     'commandname arg1 arg2 ... argN'
  1165.  
  1166.     For Example:
  1167.  
  1168.     address 'XIT'
  1169.     'select Screen Window'
  1170.     'closewindow'
  1171.  
  1172.     Or:
  1173.  
  1174.     address 'XIT' 'flash'
  1175.  
  1176.     Example ARexx Script:
  1177.  
  1178.     /* Test ARexx Scripit */
  1179.  
  1180.     address XIT
  1181.     'verbose off'
  1182.     'select wait 500 ABORT'
  1183.     'wb open dh2'
  1184.     'wb open access'
  1185.     'wb open Access!'
  1186.     'select Access ^5'
  1187.     'menu Phone Re-dial'
  1188.  
  1189.     This script will:
  1190.     1. Find Scripit's portname.
  1191.     2. Make sure that verbose mode is off.  (just in case it was turned
  1192.        on earlier by another script.)
  1193.     3. Set the select wait delay to 500 (10 seconds) and abort mode on.
  1194.        (read the select commands section for details.)
  1195.     4. Open the Workbench DH2 icon.
  1196.     5. Open the 'Access' drawer from DH2's window.
  1197.     6. Load Access!
  1198.     7. Wait for all of Access's five windows to come up.
  1199.     8. Send a 'Phone' 'Re-dial' command to Access.
  1200.  
  1201.  
  1202.     Getting Results from Scripit:
  1203.     -----------------------------
  1204.  
  1205.     The command sent from ARexx to Scripit can be any valid Scripit command.
  1206.     There are also a set of special 'Query' commands that only work with
  1207.     ARexx.
  1208.  
  1209.     The Query commands return a result string to ARexx from Scripit
  1210.     depending on what the Query command was.  You MUST, however, turn on the
  1211.     RESULTS option in ARexx before using any Query command, otherwise no
  1212.     result will be returned.
  1213.  
  1214.     The file 'Test.rexx' has an example rexx script that sets the RESULTS
  1215.     option on, loads Scripit, waits for Scripit to load, then sends the some
  1216.     query commands to Scripit.
  1217.  
  1218.  
  1219.     The following is the list of Query commands:
  1220.  
  1221.  
  1222.  
  1223.                     Query Commands:  For use with ARexx only
  1224.                     ----------------------------------------
  1225.  
  1226. QUERY WINDOW
  1227.  
  1228.             Returns the name currently selected window.
  1229.  
  1230. QUERY SCREEN
  1231.  
  1232.             Returns the name of the screen of the currently selected window.
  1233.  
  1234. QUERY WINDATA
  1235.  
  1236.             Returns data on the currently selected window in the following
  1237.             format:
  1238.             [LeftEdge] [TopEdge] [Width] [Height]
  1239.  
  1240. QUERY SCREENDATA
  1241.  
  1242.             Returns data on the currently selected screen in the following
  1243.             format:
  1244.             [LeftEdge] [TopEdge] [Width] [Height]
  1245.  
  1246. QUERY WINLIMITS
  1247.  
  1248.             Returns the window limits of the currently selected window in
  1249.             the following format:
  1250.             [MinWidth] [MinHeight] [MaxWidth] [MaxHeigth]
  1251.  
  1252. QUERY ACTIVEWINDOW
  1253.  
  1254.             Returns the name of the currently active window.
  1255.  
  1256. QUERY ACTIVESCREEN
  1257.  
  1258.             Returns the name of the currently active screen.
  1259.  
  1260. QUERY SCREENFLAGS
  1261.  
  1262.             Returns a string with the mode of the current screen.
  1263.  
  1264. QUERY WINDOWFLAGS
  1265.  
  1266.             Returns a string with the mode of the current window.
  1267.  
  1268. QUERY TEXTMODE
  1269.  
  1270.             Returns the current text mode of the selected window.
  1271.             Format: [Left] [Top] [FrontPen] [BackPen] [DrawMode]
  1272.             e.g.  10 10 1 0 JAM1
  1273.  
  1274. QUERY FONT
  1275.  
  1276.             Returns the current font of the selected window.
  1277.             Format: [Fontname] [Fontsize]
  1278.             e.g. topaz 11
  1279.  
  1280. QUERY MODE  <mode>
  1281.  
  1282.             Sets the current result returning method to ARexx.  Mode can be
  1283.             SHORT, LONG, or BOTH.
  1284.  
  1285. QUERY POINTERPOS
  1286.  
  1287.             Returns the current position of the pointer in the front screen.
  1288.             Format:  [pointer x] [pointer y]
  1289.  
  1290. QUERY MOUSEPOS
  1291.  
  1292.             Returns the current position of the mouse relative to the
  1293.             currently selected window.
  1294.             Format:  [mouse x] [mouse y]
  1295.  
  1296. QUERY PATH  <filename>
  1297.  
  1298.             Returns the full path to the file or directory specified.
  1299.             The returned string will contain the full pathname to the file.
  1300.  
  1301. QUIT        This will tell Scripit to leave the resident mode, close its
  1302.             ARexx port, and quit completely.  Only use this if you really
  1303.             want Scripit to unload itself.
  1304.  
  1305.  
  1306. Note:       In all QUERY commands, QUERY can be replaced with a question
  1307. -----       mark.  e.g.  'Q WINDOW' is the same as 'QUERY WINDOW'.
  1308.  
  1309. ----------------------------------------------------------------------------
  1310.  
  1311.                           COMMAND ARGUMENTS
  1312.                           -----------------
  1313.  
  1314. The argument(s) to any command of the above can be either a string, an
  1315. integer, or a string variable, an integer variable, or even a forumla.
  1316.  
  1317. For example:
  1318.  
  1319.     con echo "Test"
  1320.     con echo 1234
  1321.     con echo $test
  1322.     con echo #test
  1323.     con echo #test/(10+2)
  1324.  
  1325. Since these are all fed into Scripit as strings, it has to decide what to do
  1326. with the argument based on the following logic:
  1327.  
  1328.     1. If the first character of the is a $, then this is a string variable.
  1329.  
  1330.     2. If the first character of the is a #, then this either an integer
  1331.        variable or an equation starting with an integer variable.
  1332.  
  1333.     3. If the first char of the string is neither, then it is a either a
  1334.        string or an integer, based on the command that interprets it.
  1335.  
  1336. Notes:
  1337.  
  1338. - The quotes make no difference when evaluating the argument, they just
  1339.   serve to seperate arguments.
  1340.  
  1341. - If you wish to use double quote character  as part of the argument string,
  1342.   you can use the alternate double quote character: (~).  
  1343.  
  1344.     For example:
  1345.  
  1346.     PRINT ~This is a "test" of using double quotes (").\n~
  1347.  
  1348.     You will get:
  1349.  
  1350.     This is a "test" of using double quotes (").
  1351.  
  1352.  
  1353. ----------------------------------------------------------------------------
  1354.                           
  1355.                         LOGIC AND FLOW CONTROL
  1356.                         ======================
  1357.  
  1358. Scripit supports the following logic and flow control commands:
  1359.  
  1360. BEGIN:
  1361. ------
  1362.  
  1363. BEGIN is the command that marks the beginning of a script.  This is
  1364. essential and MUST be included in every script.  Scripit currently scans for
  1365. the BEGIN statement and will start execution of the script at that point.
  1366. If it doesn't find the BEGIN statement, it will start execution at the first
  1367. line of the script.  However, future versions of Scripit will _not_ execute
  1368. any script that doesn't have the BEGIN statement, so make sure you use it
  1369. always.
  1370.  
  1371.  
  1372. LABEL/GOTO:
  1373. -----------
  1374.  
  1375. Labels define specific points in a script.  The GOTO command is then used
  1376. to continue execution of the script at the requested label.  Example:
  1377.  
  1378.     LABEL EndlessLoop
  1379.     con echo "aaaa"
  1380.     GOTO  EndlessLoop
  1381.  
  1382. Label names are not case-sensitive and are significant upto 24 characters.
  1383. Double-quotes are only needed for label names when you want to use spaces,
  1384. tabs, or commas in the label name.
  1385.  
  1386. You can also use the shorthand version of the LABEL command.  Just use the
  1387. label name and a colon.  e.g.:
  1388.  
  1389.     EndlessLoop:
  1390.     con echo "aaaa"
  1391.     GOTO  EndlessLoop
  1392.  
  1393.  
  1394. GOSUB/RETURN:
  1395. -------------
  1396.  
  1397. GOSUB and RETURN work exactly as in BASIC.  GOSUB transfers execution to
  1398. a subroutine while preserving a return pointer to the next line after
  1399. the GOSUB statement.  A RETURN statement picks up the last return pointer
  1400. stored on the return 'stack' and continues execution there.  For example:
  1401.  
  1402.     IF #a > 100
  1403.     CON ECHO "WARNING: Value is too high"
  1404.     GOSUB Complain
  1405.     END
  1406.  
  1407.     Complain:
  1408.     CON ECHO "A = " #a
  1409.     RETURN
  1410.  
  1411. You can nest upto 24 levels of GOSUBS.  Scripit will abort with an error
  1412. message if you pass that level.
  1413.  
  1414.  
  1415. IF/ELSE/ENDIF:
  1416. --------------
  1417.  
  1418. IF evaluates a statement and based on whether that statement is true
  1419. (non-zero) or false (zero) it will execute other statements.  The format
  1420. of the IF construct is like this:
  1421.  
  1422.     IF #a >= 10
  1423.     do something
  1424.     ELSE
  1425.     do something else
  1426.     ENDIF
  1427.  
  1428.     or:
  1429.  
  1430.     IF $test
  1431.     do something
  1432.     ENDIF
  1433.  
  1434. The ELSE part of the construct is optional, but the ENDIF statement is
  1435. essential.  You can nest IF constructs to as many levels as you like.
  1436. Indenting nested IFs is recommended for clarity.  The section 'Mathematical
  1437. Expressions' explains IF evaluation more.
  1438.  
  1439. Note:  Only a GOTO statement can break out of an IF construct.
  1440.  
  1441.  
  1442. WHILE/ENDWHILE:
  1443. ---------------
  1444.  
  1445. The WHILE/ENDWHILE construct allows you to write loops more easily.  The
  1446. format of the while loop is:
  1447.  
  1448.     WHILE #a <= 10
  1449.     #a = #a + 1
  1450.     CON ECHO #a
  1451.     ENDWHILE
  1452.  
  1453. You can nest upto 24 levels of WHILE constructs.  GOTOs do _not_ break out
  1454. of the while construct.  For example:
  1455.  
  1456.     #a = 1000
  1457.     WHILE #a > 10
  1458.     IF #a > 100
  1459.     GOTO Test
  1460.     ENDIF
  1461.     CON ECHO #a
  1462.     LABEL Test
  1463.     #a = #a - 10
  1464.     ENDWHILE
  1465.  
  1466.  
  1467. END:
  1468. ----
  1469.  
  1470. The END statement simply ends execution of the script.  For Example:
  1471.  
  1472.     IF #a > 1000
  1473.     CON ECHO "Value too big."
  1474.     END
  1475.     ENDIF
  1476.  
  1477.  
  1478. SCRIPT/SUBSCRIPT:
  1479. -----------------
  1480.  
  1481. The SCRIPT command allows you to execute another Scripit script from within
  1482. a script.  E.G.
  1483.  
  1484.     SCRIPT a_script_name
  1485.  
  1486. Script execution will stop at the current point in the old script and will
  1487. _not_ return.  Scripit will end when the new script ends.  The SUBSCRIPT
  1488. command is identical except that control returns to the calling script one
  1489. the called script ends.
  1490.  
  1491. All variables are preserved and will be shared between scripts!
  1492.  
  1493. ----------------------------------------------------------------------------
  1494.  
  1495.                         Sending Text to a program
  1496.                         =========================
  1497.  
  1498.  
  1499. Scripit can send text to any program via the 'KEY' command.  This command
  1500. will translate the string text argument into a set of raw key events that
  1501. are sent to the currently selected window based on a set of rules:
  1502.  
  1503. Rule 1:  If the window selected is looking for raw key events, the raw
  1504.          keys will be sent its its message port.
  1505.  
  1506. Rule 2:  If the window selected is not looking for raw key events, the raw
  1507.          keys will be sent to the input device.  This will then be filtered
  1508.          by Intuition and sent to the currently active window.  So, you must
  1509.          make sure that the selected window is active by using the
  1510.          ACTIVATEWINDOW command.
  1511.  
  1512. Rule 3:  When translating the string argument, all characters will be
  1513.          converted to raw keys, except when a '\' (a backslash) is found.
  1514.          The backslash is a command that allows you to specify special keys.
  1515.  
  1516.  
  1517.          The following table summarizes the backslash commands:
  1518.  
  1519.  
  1520.  
  1521.                            Special "KEY" Format:
  1522.                            ---------------------
  1523.  
  1524.     \a      Alt Qualifier                   \o      (unused)                         
  1525.     \b      Backspace                       \p      Pad Qualifier            
  1526.     \c      Control Qualifier               \q      Double-Quote (")                   
  1527.     \d      Delete                          \r      Right Qualifier Modifier
  1528.     \e      Enter Key (on numeric pad)      \s      Shift Qualifier
  1529.     \f      Function Key:  F0 to F9         \t      Tab
  1530.     \g      (unused)                        \u      (unused)
  1531.     \h      Help                            \v      Mouse Button Qualifier
  1532.     \i      Turn on input device mode       \w      Mouse Button Click
  1533.     \j      Turn off input device mode      \x      Escape
  1534.     \k      (unused)                        \y      (unused)
  1535.     \l      Left Qualifier Modifier         \z      End Qualifier.
  1536.     \m      Amiga Qualifier                 \\      Backslash
  1537.     \n      Return Key                      \###    ASCII code. (000 to 255)
  1538.    
  1539.    
  1540. Notes:
  1541.         The \a, \s, \m and \v qualifier commands always default to using the
  1542.         left key.  e.g.  \a  will use the Left Alt key.  If you need to send
  1543.         a Right Alt key, use the qualifier modifier 'r' i.e. \ra (or \rs,
  1544.         \rm)  For the mouse buttons, you _must_ specify the left or right
  1545.         modifier: e.g.: \lv is the left mouse button, \rv is the right mouse
  1546.         button.  Using \v only will simulate the middle mouse button, which
  1547.         is currently supported by the Amiga's system software, but not by
  1548.         most programs.  The \w 'mouse button click' need to \z since it is
  1549.         considered as a key press itself, unlike the \v.
  1550.  
  1551.         All qualifier commands: \a, \s, \m, and \c are cumulative.  i.e.
  1552.         \a\s\ch  will send an  Alt-Shift-Control-h sequence.
  1553.  
  1554.         If you need to send only qualifier events without any actual keys,
  1555.         use the \z (end qualifier) command.  This will terminate the
  1556.         qualifier cumulating and send a qualifier rawkey event.  e.g.
  1557.         \c\lm\rm\z will send the infamous Control-LeftAmiga-RightAmiga
  1558.         sequence!  (This will not actually reboot the machine since the
  1559.         reset sequence is built into the keyboard, not the system.)
  1560.  
  1561.         If you need to send the rawkeys to the input device, use the \i
  1562.         command.  All text following this will be sent to the input device,
  1563.         until the string ends, or until the \j command is found.
  1564.  
  1565.         Important Note:
  1566.  
  1567.         Some programs prefer the 'enter' (\e) to 'return' (\n).  Use as
  1568.         appropriate.  If you get a reverse M instead of an actual return
  1569.         then you probably need to use the \e instead of \n.  The \e is
  1570.         mostly used when simulating entering text into a gadget via the KEY
  1571.         command.
  1572.  
  1573. Examples:
  1574.  
  1575.         KEY "Test.\n"       Sends 'Test.' then a Return.
  1576.         KEY "Test,\b.\n"    Sends 'Test,' a backspace, then '.' and Return.
  1577.         KEY "\h"            Simulates pressing the Help key.
  1578.         KEY "\a\rsk"        Sends a LeftAlt-RightShift-k.
  1579.         KEY "\032"          Sends the ASCII character # 32.
  1580.         KEY "\qA Quote.\q"  Sends "A Quote." (with the double-quotes.)
  1581.         KEY "\e"            Simulates pressing the Escape key.
  1582.         KEY "\f2"           Simulates pressing Function Key 2.  (F2)
  1583.         KEY "\a\s\f0"       Simulates pressing Alt-Shift-F10.
  1584.  
  1585. ----------------------------------------------------------------------------
  1586.  
  1587.                                 VARIABLES
  1588.                                 ---------
  1589.  
  1590.  
  1591. Variables in Scripit are either integer or string variables.
  1592.  
  1593. Integer Variables:
  1594. ------------------
  1595.  
  1596. These are all in the format:  #varname
  1597. e.g.  #a  #i  #test  #something .. or even #10 or #1010test
  1598.  
  1599. These can be used anywhere instead of any argument.  If the argument
  1600. for another function is expected to be a string, then the variable is
  1601. converted to a string before being passed that function.
  1602. e.g.  GFX TEXT #var
  1603.  
  1604. Variables names can consist of any combination of letters, numbers or
  1605. symbols.  The first character must always be a # sign.  The variable
  1606. names are significant upto the first 16 characters.  Variable names
  1607. are NOT case-sensitive.  i.e.  #test is the same as #TEST.
  1608.  
  1609. You can use any character in the name of variable as long as it is not
  1610. one of the following: + - / * = | & ^ % # space
  1611.  
  1612. To assign any value to an integer variable just use:
  1613.  
  1614. #a = 100
  1615.  
  1616. (The command is actually  LET #a = 100)
  1617.  
  1618. Integer variables can store numbers in the range of -2,147,483,648 to
  1619. +2,147,482,647  (i.e. a signed 32 bit integer).
  1620.  
  1621.  
  1622. String Variables:
  1623. -----------------
  1624.  
  1625. These are the same as integer variables, except they all start with a
  1626. $ sign.  e.g. $variable, $Test, etc.
  1627.  
  1628. To assign any string to a string variable use:
  1629.  
  1630. $a = "TEST STRING"   or even  $a = TEST
  1631.  
  1632. $a = $b   works as well.
  1633.  
  1634. To concatenate strings use:
  1635.  
  1636. $a = $b $c "TEST" $x #i  etc.
  1637.  
  1638. NOTE:  String and integer variables of the same name are actually the
  1639. same variable!  If you set a string variable then the value of its
  1640. contents are stored in the integer variable of the same name.
  1641.  
  1642.  
  1643. SHOWVARS:
  1644. ---------
  1645.  
  1646. To view all current variables issue the command SHOWVARS and you will
  1647. get a list of the currently active variables.  (non system ones only)
  1648.  
  1649. For Example:
  1650.  
  1651. SHOWVARS
  1652.  
  1653.  Variable Name    Integer  Size       String
  1654. ---------------  --------  ----  -----------------
  1655. a                       0    14  A Test String
  1656. ab                      0    20  Another Test String
  1657. abc                   100     0
  1658. Test                    0     8  Testing
  1659. Info                    0    12  Information
  1660. avar                  123     0
  1661. arg[1]                  0    14  first argument
  1662. arg[2]                  0    15  second argument
  1663. arg[3]                 10     2  10
  1664. arg[4]                 12     2  12
  1665. result                  0     0
  1666. result2                 0     0
  1667. result3                 0     0
  1668.  
  1669. SHOWVARS will also list out the user supplied arguments (arg[1] to arg[9])
  1670. at the end of this list, and after those, it will list out the contents
  1671. of the three integer and string result variables.
  1672.  
  1673. Note:  SHOWVARS has a shorthand version:  '?'.  (intended for use with the
  1674. interactive mode.)
  1675.  
  1676. You can also specify the variables to show using the SHOWVARS command. e.g.:
  1677.  
  1678. SHOWVARS abc Test avar
  1679.  
  1680.  
  1681. There is no limit on the number of variables in Scripit.  String variables
  1682. can store strings of any length.  (upto available memory)  All variables
  1683. are allocated memory and freed on the fly.
  1684.  
  1685.  
  1686. Arrays:
  1687. -------
  1688.  
  1689. Arrays in Scripit are a bit different from other languages.  The format for
  1690. using them is like C.  e.g.:  #test[10]  where the number between [] is the
  1691. element number.  The element number can be any valid math formula.  e.g.
  1692. #test[#a/2].
  1693.  
  1694. Arrays do not need to be predefined to be used.  They can be of any size.
  1695. You can also have negative elements.  (e.g.  #test[-10]).
  1696.  
  1697. Array elements are allocated and used as they are referenced, so if you
  1698. only used #test[32], #test[100] and #test[-32], only 3 elements will be
  1699. used and allocated memory.
  1700.  
  1701. Array elements are the same as normal variables in that you can reference
  1702. the same element as either a string or an integer.  i.e. #test[100] and
  1703. $test[100] are the same variable.  
  1704.  
  1705. ----------------------------------------------------------------------------
  1706.  
  1707.                             SYSTEM VARIABLES
  1708.                             ----------------
  1709.  
  1710.  
  1711. All 'system variables' are read only variables maintained by Scripit.
  1712. They are either string or integer variables and follow the same notation
  1713. as normal variables.  (i.e. they start with either a $ sign or a # sign.)
  1714. System variables can be used in place of ANY argument to any command.
  1715.  
  1716.  
  1717. Strings:
  1718. --------
  1719.  
  1720. Variables:
  1721.  
  1722. $screen       The title of the currently selected screen.
  1723.  
  1724. $window       The title of the currently selected window.
  1725.  
  1726. $request      The returned string from the file requester.
  1727.               (this contains the full pathname of the selected file.)
  1728.  
  1729. $reqdir       The directory selected in the file requester.
  1730.  
  1731. $reqfile      The file name selected in the file requester.
  1732.               (not the full path)
  1733.  
  1734. $scriptname   This is the name of the script being executed.
  1735.  
  1736. $arg[n]       A user supplied argument that is taken from the CLI command:
  1737.               Scripit [options] [scriptname] [arg1] [arg2] ... [arg9]
  1738.               This can range from $arg[1] to $arg[9]
  1739.               (Note: you can access $arg[n] as an integer by using #arg[n])
  1740.               These args are guaranteed to contain either a valid argument
  1741.               or a null value, they will never contain garbage.
  1742.  
  1743. $time         The current time in the format  HH:MM:SS
  1744.               $hour $minute $second  contain the current hours, minutes,
  1745.               seconds.
  1746.  
  1747. $date         The current date in the format  MM.DD.YYYY
  1748.               $year $month $day   contain the current year,month,day.
  1749.               Note: $month contains a 3 character string with the name of
  1750.               the current month.  e.g. 'Jan'.
  1751.  
  1752. $version      The version number of Scripit.  (Current text # is "1.20")
  1753.  
  1754. $currentdir   The full pathname of the current directory.
  1755.  
  1756. Constants:
  1757.  
  1758. $lf           The line feed character.  (i.e. \n)
  1759.  
  1760.  
  1761. Integers:
  1762. ---------
  1763.  
  1764. Variables:
  1765.  
  1766. #argcount     The number of user supplied arguments.  (can range between 0-9)
  1767. #time         The current time in the format  HHMMSS
  1768.               #hour #minute #second   contain the current hours, minutes,
  1769.               seconds.
  1770. #date         The current date in the format  YYYYMMDD
  1771.               #year #month #day   contain the current year,month,day.
  1772. #version      The version number of Scripit.  (Currently = 120)
  1773.  
  1774. The following all apply to the currently selected window and/or screen:
  1775.  
  1776. #win.width    The window's width.
  1777. #win.height   The window's height.
  1778. #win.top      The window's top edge.
  1779. #win.left     The window's left edge.
  1780. #scr.width    The screen's width.
  1781. #scr.height   The screen's height.
  1782. #scr.top      The screen's top edge.
  1783. #scr.left     The screen's left edge.
  1784. #win.pen0     The window's front pen color.
  1785. #win.pen1     The window's back pen color.
  1786. #win.mx       The x position of the mouse pointer relative to the window.
  1787. #win.my       The y position of the mouse pointer relative to the window.
  1788. $scr.fontname The name of the current font in the screen.
  1789. #scr.fontsize The point size of the current font in the screen.
  1790. #win.fontsize The point size of the current font in the window.
  1791. #win.x        The x position of the gfx write pointer in the window.
  1792.               (This is the one set with GFX MOVE)
  1793. #win.y        The y position of the gfx write pointer in the window.
  1794. #mousex       The pointer x position relative to the actual monitor.
  1795. #mousey       The pointer y position relative to the actual monitor.
  1796.  
  1797. The next variables are only for people that know what to do with them:
  1798.  
  1799. #win.flags    These are the window flags as per the Window structure.
  1800. #scr.flags    These are the screen flags as per the Screen structure.
  1801.  
  1802. Note:
  1803.  
  1804. System variables are predefined.  However, that doesn't mean that their
  1805. names are reserved.  You can use the name of a system variable for your
  1806. own variable, but after that you won't be able to access the system variable
  1807. anymore.  i.e. user variable names will override system variable names.
  1808. This applies to all system variables including $arg[1] to $arg[9].
  1809.  
  1810. ----------------------------------------------------------------------------
  1811.  
  1812.                             Mathematical Expressions
  1813.                             ------------------------
  1814.  
  1815.  
  1816. Scripit can evaluate complex mathematical expressions that contain any
  1817. of the following math operators:
  1818.  
  1819.     ^   power
  1820.  
  1821.     *   multiply
  1822.     /   divide
  1823.     %   Modulo
  1824.  
  1825.     +   add
  1826.     -   subtract
  1827.  
  1828.     &   AND
  1829.     |   OR
  1830.  
  1831.     (   
  1832.     )   parentheses
  1833.  
  1834.  
  1835. The math expression evaluator is called into action ONLY in two commands:
  1836. The IF command and the LET (assign) command.  (next version will support
  1837. math expressions with any command.)
  1838.  
  1839. Examples:
  1840.  
  1841. LET #a = (100+3)/#b
  1842.  
  1843. (the LET keyword is not essential.)
  1844.  
  1845. IF #a+100 >= (100+3)^2+#b
  1846.  
  1847. The operators are evaluated on a priority basis.  The higher priority
  1848. operator gets evaluated first.  The above list lists them from the
  1849. highest to the lowest priority.  Parentheses change the priority by
  1850. assigning higher priority to expressions between parentheses.
  1851.  
  1852.  
  1853. The IF command can use any of the following comparison operators:
  1854.  
  1855.     >   Greater than
  1856.     <   Less than
  1857.     >=  Greater than or equals
  1858.     <=  Less than or equals
  1859.     ==  Equals
  1860.     =   Assign  (read below)
  1861.     <>  Not equals
  1862.         No operator
  1863.  
  1864. If no operator is provided then the expression is evaluated, and if
  1865. it is not 0 then it is true, otherwise it is false.  E.g.
  1866.  
  1867.     IF #a
  1868.  
  1869. If the assign '=' operator is used in an IF statement, then the
  1870. assignment is carried out and that value is used to determine
  1871. true/false.  e.g.
  1872.  
  1873.     IF #a = 100/12
  1874.  
  1875.     This does the same as:
  1876.  
  1877.     #a = 100/12
  1878.     IF #a
  1879.  
  1880.  
  1881.  
  1882. NOTE:  In both the LET and IF statement, the comparison operator
  1883.        MUST be separated by spaces.  All other arguments do not
  1884.        need spaces.
  1885.  
  1886. ----------------------------------------------------------------------------
  1887.  
  1888.                          STRING ASSIGNMENT & COMPARISON
  1889.                          ------------------------------
  1890.  
  1891.  
  1892.     String variable assignment works like this:
  1893.  
  1894.     LET $a = "test"
  1895.     LET $beta = "test" $a $a $test
  1896.  
  1897.     You can only have on argument before the assign operator.  All
  1898.     arguments after it are concatenated into one string and stored
  1899.     in the string variable specified.
  1900.  
  1901.  
  1902.     String comparisons work the same way as integer comparisons.  E.G.
  1903.  
  1904.     IF $test
  1905.  
  1906.     This will be true is $test is defined and contains something, FALSE
  1907.     if not.
  1908.  
  1909.     IF $test == "hello"
  1910.     IF $test >= "hello"
  1911.     etc.
  1912.  
  1913.     This is a string comparison that is based on an alphanumeric sort.
  1914.     e.g. 'abc' is smaller than 'bbc' etc.  String length is only used
  1915.     when the all the letters match. e.g.  'abc' < 'abcd'
  1916.  
  1917.     With string comparisons, all arguments before the operator are
  1918.     concatenated into one string, and all arguments after it are
  1919.     concatenated into another.
  1920.  
  1921.     IF "abc" $test "bcd" >= $info $test $new
  1922.  
  1923.  
  1924.     Immediate resolve assignment:
  1925.     -----------------------------
  1926.  
  1927.     The ?= operator is the same as the = operator when using string
  1928.     variables except that the ?= operator resolves integer variable names in
  1929.     the string immediately.  For example:
  1930.  
  1931.     $test = #date
  1932.     Using this $test will contain "#date".
  1933.  
  1934.     $test ?= #date
  1935.     Using this $test will contain the current date "19890926".
  1936.  
  1937.     (Note: this only effect assigning integer variables to string variables.
  1938.     String variable to string variable assign is always immediately
  1939.     resolved.  i.e.  $t = $date  and  $t ?= $date  both result in $t
  1940.     containing "1989.09.26")
  1941.  
  1942.     Another note:  The ?= operator makes no difference when assigning to
  1943.     integer variables since such assignments are always immediately
  1944.     resolved.
  1945.  
  1946.     (I hope this made some sense to you! :-)
  1947.  
  1948.     For example:  The following will open a console window the size of
  1949.     the front screen:
  1950.  
  1951.         begin
  1952.         select active
  1953.         $console ?= "CON:0/0/" #scr.width "/" #scr.height "/ConsoleTitle"
  1954.         con open $console
  1955.  
  1956.     Note: you should always have the integer variable name as a separate
  1957.     argument.  This is because Scripit has no way of telling where the
  1958.     variable name ends and the rest of the text begins.
  1959.  
  1960. ----------------------------------------------------------------------------
  1961.  
  1962.                                 RESULT CODES
  1963.                                 ------------
  1964.  
  1965. Many commands in Scripit return result codes via the system variables
  1966. #result, #result2, #result3, $result, $result2, and $result3.  As a rule,
  1967. #result will contain a 0 if the command failed, or 1 or above if the command
  1968. succeeded.
  1969.  
  1970. Each command uses these result codes to return different codes.  You can
  1971. find out what these codes are in the description of each command in this
  1972. file.
  1973.  
  1974. Most commands will set/clear the return results except for the following,
  1975. which are guaranteed not to modify the result variables:
  1976.  
  1977. IF, ELSE, ENDIF, WHILE, ENDWHILE, GOTO, LABEL, GOSUB, RETURN.
  1978.  
  1979. ----------------------------------------------------------------------------
  1980.  
  1981.                                 TIPS & HINTS
  1982.                                 ------------
  1983.  
  1984. You can use the Scripit package (Scripit and Lister, specifically) in order
  1985. to remotely control another Amiga via the serial port (or modem)  Just issue
  1986. a 'newcli aux:' command on the Amiga to be controlled, and then use a
  1987. terminal program on the other Amiga.  Use Lister to find out what screens or
  1988. windows (and menus, gadgets) are on the remote Amiga, and use Scripit itself
  1989. to drive the programs on the remote Amiga.  If you need more details on how
  1990. to do this, leave me a message in Compuserve.
  1991.  
  1992. ------------------------------------------------------------------------------
  1993. Copyright 1989  Khalid Aldoseri.                               7 October 1989.
  1994. ------------------------------------------------------------------------------
  1995.